package org.dromara.vehicle.modules.gaoDe.controller;

import lombok.RequiredArgsConstructor;
import org.dromara.common.core.domain.R;
import org.dromara.common.web.core.BaseController;
import org.dromara.vehicle.modules.gaoDe.domain.vo.GdTipVo;
import org.dromara.vehicle.modules.gaoDe.service.GdPoiService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * 高德控制器
 *
 * @author ckk
 * @date 2025/08/15
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("gd")
public class GaoDeController extends BaseController {

    private final GdPoiService gdPoiService;

    /**
     * 输入提示
     *
     * @param keyWord  关键字
     * @param location 位置(经度,纬度)
     * @return {@link R }<{@link Map }<{@link String }, {@link Object }>>
     */
    @GetMapping("tips")
    public R<List<GdTipVo>> tips(@RequestParam String keyWord, @RequestParam(defaultValue = "location") String location) {
        return R.ok(gdPoiService.tips(keyWord, location));
    }
}
